package com.hyt.it.ogt.ks.mapper.mongodb;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import com.hyt.it.ogt.ks.model.entity.mongodb.CandidateAnswerLog;

/**
 * @author wuyingge
 * @ClassName CandidateAnswerLogMapper.java
 * @Description 考生保存答案请求参数日志
 * @createTime 2021年10月16日 14:27:00
 */
@Repository
public interface CandidateAnswerLogRepository extends MongoRepository<CandidateAnswerLog, String> {

    /**
     * 在 创建日期之前的
     * @param
     * @return
     */
    @Query(value="{'createDate':{'$gte':?0}}")
    List<CandidateAnswerLog> findByCreateDateBetween(LocalDateTime time, Pageable pageable);

    @Query(value="{'candidateId': ?0}")
    List<CandidateAnswerLog> findCandidateAnswerLogsByCandidateId(String candidateId);
}
